package net.hn.hnms.biz.sewage.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * @author 智呈物联 nzw
 * @date 2022/9/22
 */
@Entity
@Table(name = "industrial_wastewater_ods", schema = "wscl", catalog = "huaneng-safety")
public class IndustrialWastewaterOdsEntity {
    private Long id;
    private Date codTime;
    private BigDecimal codValue;
    private Long shiftId;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-id")
    @GenericGenerator(name = "custom-id", strategy = "net.hn.hnms.biz.sewage.util.CustomIDGenerator")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "COD_time")
    public Date getCodTime() {
        return codTime;
    }

    public void setCodTime(Date codTime) {
        this.codTime = codTime;
    }

    @Basic
    @Column(name = "COD_value")
    public BigDecimal getCodValue() {
        return codValue;
    }

    public void setCodValue(BigDecimal codValue) {
        this.codValue = codValue;
    }

    @Basic
    @Column(name = "shift_id")
    public Long getShiftId() {
        return shiftId;
    }

    public void setShiftId(Long shiftId) {
        this.shiftId = shiftId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IndustrialWastewaterOdsEntity that = (IndustrialWastewaterOdsEntity) o;
        return id == that.id &&
                shiftId == that.shiftId &&
                Objects.equals(codTime, that.codTime) &&
                Objects.equals(codValue, that.codValue);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, codTime, codValue, shiftId);
    }
}
